package com.zwh.sharding.modules.web;

import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zwh.sharding.modules.dto.XxlJobUserSearchDto;
import com.zwh.sharding.modules.entity.XxlJobUser;
import com.zwh.sharding.modules.service.XxlJobUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * @author zwh
 * @date 2023-5-11
 */
@Controller
@RequestMapping("data")
public class XxlJobUserController {
    @Autowired
    private XxlJobUserService xxlJobUserService;
    @RequestMapping("/pageList")
    @ResponseBody
    public Page<XxlJobUser> pageList(XxlJobUserSearchDto dto) {
        Page<XxlJobUser> page = new Page<>(dto.getPageNo(), dto.getPageSize());
        return xxlJobUserService.pageList(page, dto);
    }


    @RequestMapping("/list1")
    @ResponseBody
    public List<XxlJobUser> list(XxlJobUser entity){
        return xxlJobUserService.findSimpleList(entity);
    }

    @RequestMapping("/list2")
    @ResponseBody
    public List<XxlJobUser> list2(XxlJobUser entity){
        return xxlJobUserService.findSimpleList2(entity);
    }
}
